package com.hera.process.config.service.impl;

import java.util.List;

import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hera.base.util.FiltroDTO;
import com.hera.process.config.dao.DepartmentDao;
import com.hera.process.config.domain.Department;
import com.hera.process.config.service.DepartmenService;

@Service("departmenService")
public class DepartmenServiceImpl implements DepartmenService {

	static final Logger logger = Logger.getLogger(DepartmenServiceImpl.class);

	@Autowired
	private DepartmentDao departmentDao;
	
	public DepartmenServiceImpl() {
		
		
	}
	
	
	@Override
	public Department findById(Long id) {
		
		return departmentDao.findOne(id);
	}

	@Override
	public void update(Department entity) {
		
		departmentDao.save(entity);
	}

	@Override
	public void save(Department entity) {
		
		departmentDao.save(entity);
	}

	@Override
	public void delete(Department entity) {
		
		departmentDao.delete(entity);
	}

	@Override
	public List<Department> findAll() {
		
		return departmentDao.findAll();
	}

	@Override
	public List<Department> findAll(FiltroDTO filtroDTO) {
		
		return departmentDao.obtenerEntidadesPorFiltros(filtroDTO);
	}

}
